import { post, get, _delete, put } from '@/lin/plugin/axios'

class MonitoringRoom {
  static async addMonitoringRoom(data) {
    const res = await post('v1/ag/monitoringroom/create', data)
    return res
  }

  static async getMonitoringRoom(id) {
    const res = await get(`v1/ag/monitoringroom/${id}`)
    return res
  }

  static async editMonitoringRoom(id, data) {
    const res = await put(`/v1/ag/monitoringroom/${id}`, data)
    return res
  }

  static async deleteMonitoringRoom(id) {
    const res = await _delete(`/v1/ag/monitoringroom/${id}`)
    return res
  }

  static async getMonitoringRoomByPage(page = 0, count = 10) {
    const res = await get('/v1/ag/monitoringroom/page', { page, count })
    return res
  }

  static async getMonitoringRoomList() {
    const res = await get('/v1/ag/monitoringroom/list')
    return res
  }

  static async search({ keyword, page, count }) {
    const res = await get('v1/ag/monitoringroom/search', {
      keyword,
      page,
      count,
    })
    return res
  }
}

export default MonitoringRoom

